package db.pojo;

import java.util.*;
import java.text.SimpleDateFormat;
import db.ext.EamenuExt;
@SuppressWarnings("unchecked")
/**
 * eamenu
 */
public class Eamenu {
	/**
	 * MENUID
	 */
	public String mENUID;
	/**
	 * MENUNAME
	 */
	public String mENUNAME;
	/**
	 * PARENTID
	 */
	public String pARENTID;
	/**
	 * ICONCLS
	 */
	public String iCONCLS;
	/**
	 * EXPANDED
	 */
	public String eXPANDED;
	/**
	 * REQUEST
	 */
	public String rEQUEST;
	/**
	 * LEAF
	 */
	public String lEAF;
	/**
	 * SORTNO
	 */
	public int sORTNO;
	/**
	 * REMARK
	 */
	public String rEMARK;
	/**
	 * ICON
	 */
	public String iCON;
	/**
	 * MENUTYPE
	 */
	public String mENUTYPE;
	/**
	 * SHORTCUT
	 */
	public String sHORTCUT;
	/**
	 * WIDTH
	 */
	public int wIDTH;
	/**
	 * HEIGHT
	 */
	public int hEIGHT;
	/**
	 * SCROLLBAR
	 */
	public String sCROLLBAR;
	SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	public static EamenuExt DB = new EamenuExt(); 
	
	public Eamenu() {
		super();
	}
	
	public Eamenu(String mENUID, String mENUNAME, String pARENTID, String iCONCLS, String eXPANDED, String rEQUEST, String lEAF, int sORTNO, String rEMARK, String iCON, String mENUTYPE, String sHORTCUT, int wIDTH, int hEIGHT, String sCROLLBAR) {
		super();
		this.mENUID = mENUID; 
		this.mENUNAME = mENUNAME; 
		this.pARENTID = pARENTID; 
		this.iCONCLS = iCONCLS; 
		this.eXPANDED = eXPANDED; 
		this.rEQUEST = rEQUEST; 
		this.lEAF = lEAF; 
		this.sORTNO = sORTNO; 
		this.rEMARK = rEMARK; 
		this.iCON = iCON; 
		this.mENUTYPE = mENUTYPE; 
		this.sHORTCUT = sHORTCUT; 
		this.wIDTH = wIDTH; 
		this.hEIGHT = hEIGHT; 
		this.sCROLLBAR = sCROLLBAR; 
	}
	
	public String getMENUID() {
		return mENUID;
	}

	public void setMENUID(String mENUID) {
		this.mENUID = mENUID;
	} 
	
	public String getMENUNAME() {
		return mENUNAME;
	}

	public void setMENUNAME(String mENUNAME) {
		this.mENUNAME = mENUNAME;
	} 
	
	public String getPARENTID() {
		return pARENTID;
	}

	public void setPARENTID(String pARENTID) {
		this.pARENTID = pARENTID;
	} 
	
	public String getICONCLS() {
		return iCONCLS;
	}

	public void setICONCLS(String iCONCLS) {
		this.iCONCLS = iCONCLS;
	} 
	
	public String getEXPANDED() {
		return eXPANDED;
	}

	public void setEXPANDED(String eXPANDED) {
		this.eXPANDED = eXPANDED;
	} 
	
	public String getREQUEST() {
		return rEQUEST;
	}

	public void setREQUEST(String rEQUEST) {
		this.rEQUEST = rEQUEST;
	} 
	
	public String getLEAF() {
		return lEAF;
	}

	public void setLEAF(String lEAF) {
		this.lEAF = lEAF;
	} 
	
	public int getSORTNO() {
		return sORTNO;
	}

	public void setSORTNO(int sORTNO) {
		this.sORTNO = sORTNO;
	} 
	
	public void changeSORTNOWith(int sORTNO){
		this.sORTNO += sORTNO;
	}
	
	public void changeSORTNOWithMin(int sORTNO,int min){
		this.sORTNO += sORTNO;
		this.sORTNO = this.sORTNO < min ? min : this.sORTNO;
	}
	
	public void changeSORTNOWithMax(int sORTNO,int max){
		this.sORTNO += sORTNO;
		this.sORTNO = this.sORTNO > max ? max : this.sORTNO;
	}
	
	public void changeSORTNOWithMaxMin(int sORTNO,int max,int min){
		this.sORTNO += sORTNO;
		this.sORTNO = this.sORTNO < min ? min : this.sORTNO;
		this.sORTNO = this.sORTNO > max ? max : this.sORTNO;
	}	
	public String getREMARK() {
		return rEMARK;
	}

	public void setREMARK(String rEMARK) {
		this.rEMARK = rEMARK;
	} 
	
	public String getICON() {
		return iCON;
	}

	public void setICON(String iCON) {
		this.iCON = iCON;
	} 
	
	public String getMENUTYPE() {
		return mENUTYPE;
	}

	public void setMENUTYPE(String mENUTYPE) {
		this.mENUTYPE = mENUTYPE;
	} 
	
	public String getSHORTCUT() {
		return sHORTCUT;
	}

	public void setSHORTCUT(String sHORTCUT) {
		this.sHORTCUT = sHORTCUT;
	} 
	
	public int getWIDTH() {
		return wIDTH;
	}

	public void setWIDTH(int wIDTH) {
		this.wIDTH = wIDTH;
	} 
	
	public void changeWIDTHWith(int wIDTH){
		this.wIDTH += wIDTH;
	}
	
	public void changeWIDTHWithMin(int wIDTH,int min){
		this.wIDTH += wIDTH;
		this.wIDTH = this.wIDTH < min ? min : this.wIDTH;
	}
	
	public void changeWIDTHWithMax(int wIDTH,int max){
		this.wIDTH += wIDTH;
		this.wIDTH = this.wIDTH > max ? max : this.wIDTH;
	}
	
	public void changeWIDTHWithMaxMin(int wIDTH,int max,int min){
		this.wIDTH += wIDTH;
		this.wIDTH = this.wIDTH < min ? min : this.wIDTH;
		this.wIDTH = this.wIDTH > max ? max : this.wIDTH;
	}	
	public int getHEIGHT() {
		return hEIGHT;
	}

	public void setHEIGHT(int hEIGHT) {
		this.hEIGHT = hEIGHT;
	} 
	
	public void changeHEIGHTWith(int hEIGHT){
		this.hEIGHT += hEIGHT;
	}
	
	public void changeHEIGHTWithMin(int hEIGHT,int min){
		this.hEIGHT += hEIGHT;
		this.hEIGHT = this.hEIGHT < min ? min : this.hEIGHT;
	}
	
	public void changeHEIGHTWithMax(int hEIGHT,int max){
		this.hEIGHT += hEIGHT;
		this.hEIGHT = this.hEIGHT > max ? max : this.hEIGHT;
	}
	
	public void changeHEIGHTWithMaxMin(int hEIGHT,int max,int min){
		this.hEIGHT += hEIGHT;
		this.hEIGHT = this.hEIGHT < min ? min : this.hEIGHT;
		this.hEIGHT = this.hEIGHT > max ? max : this.hEIGHT;
	}	
	public String getSCROLLBAR() {
		return sCROLLBAR;
	}

	public void setSCROLLBAR(String sCROLLBAR) {
		this.sCROLLBAR = sCROLLBAR;
	} 
	
	
	public Map eamenuToMap() {
		Map map = new HashMap();
		try {
			map.put("mENUID",this.mENUID);
			map.put("mENUNAME",this.mENUNAME);
			map.put("pARENTID",this.pARENTID);
			map.put("iCONCLS",this.iCONCLS);
			map.put("eXPANDED",this.eXPANDED);
			map.put("rEQUEST",this.rEQUEST);
			map.put("lEAF",this.lEAF);
			map.put("sORTNO",this.sORTNO);
			map.put("rEMARK",this.rEMARK);
			map.put("iCON",this.iCON);
			map.put("mENUTYPE",this.mENUTYPE);
			map.put("sHORTCUT",this.sHORTCUT);
			map.put("wIDTH",this.wIDTH);
			map.put("hEIGHT",this.hEIGHT);
			map.put("sCROLLBAR",this.sCROLLBAR);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return map;
	}

	public Eamenu mapToEamenu(Map map){
		try {
			String mENUID =  map.get("mENUID").toString();
			String mENUNAME =  map.get("mENUNAME").toString();
			String pARENTID =  map.get("pARENTID").toString();
			String iCONCLS =  map.get("iCONCLS").toString();
			String eXPANDED =  map.get("eXPANDED").toString();
			String rEQUEST =  map.get("rEQUEST").toString();
			String lEAF =  map.get("lEAF").toString();
			int sORTNO = Integer.parseInt( map.get("sORTNO").toString());
			String rEMARK =  map.get("rEMARK").toString();
			String iCON =  map.get("iCON").toString();
			String mENUTYPE =  map.get("mENUTYPE").toString();
			String sHORTCUT =  map.get("sHORTCUT").toString();
			int wIDTH = Integer.parseInt( map.get("wIDTH").toString());
			int hEIGHT = Integer.parseInt( map.get("hEIGHT").toString());
			String sCROLLBAR =  map.get("sCROLLBAR").toString();
			Eamenu eamenu = new Eamenu(mENUID, mENUNAME, pARENTID, iCONCLS, eXPANDED, rEQUEST, lEAF, sORTNO, rEMARK, iCON, mENUTYPE, sHORTCUT, wIDTH, hEIGHT, sCROLLBAR);
			return eamenu;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	} 
	
	public String toString(){
		return eamenuToMap().toString();
	}
	
	//方便数据操作	
	public Eamenu insert(){
		return DB.insert(this);
	}
	public Eamenu update(){
		return DB.update(this);
	}
	
	public int delete(){
		return DB.delete(this);
	}
	
}
